#include "logindialog.h"
#include "ui_logindialog.h"
#include "mainwindow.h"
loginDialog::loginDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::loginDialog)
{
    ui->setupUi(this);
}

loginDialog::~loginDialog()
{
    delete ui;
}

void loginDialog::on_pushButton_start_clicked()
{
    QString subject = ui->lineEdit_subject->text();//获取考试科目
    int num = ui->spinBox_num->value();//获取考试人数
    MainWindow *mw = new MainWindow(subject,num);//创建主窗口对象，并传递考试科目和人数
    mw->show();//显示主窗口
    close();//关闭主窗口
}
